import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/jingang_for_home_entity.dart';

JingangForHomeEntity $JingangForHomeEntityFromJson(Map<String, dynamic> json) {
	final JingangForHomeEntity jingangForHomeEntity = JingangForHomeEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		jingangForHomeEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		jingangForHomeEntity.msg = msg;
	}
	final List<JingangForHomeData>? data = jsonConvert.convertListNotNull<JingangForHomeData>(json['data']);
	if (data != null) {
		jingangForHomeEntity.data = data;
	}
	return jingangForHomeEntity;
}

Map<String, dynamic> $JingangForHomeEntityToJson(JingangForHomeEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

JingangForHomeData $JingangForHomeDataFromJson(Map<String, dynamic> json) {
	final JingangForHomeData jingangForHomeData = JingangForHomeData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		jingangForHomeData.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		jingangForHomeData.name = name;
	}
	final String? sort = jsonConvert.convert<String>(json['sort']);
	if (sort != null) {
		jingangForHomeData.sort = sort;
	}
	final String? link = jsonConvert.convert<String>(json['link']);
	if (link != null) {
		jingangForHomeData.link = link;
	}
	final String? imgPath = jsonConvert.convert<String>(json['img_path']);
	if (imgPath != null) {
		jingangForHomeData.imgPath = imgPath;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		jingangForHomeData.createdAt = createdAt;
	}
	final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
	if (updatedAt != null) {
		jingangForHomeData.updatedAt = updatedAt;
	}
	final String? cateId = jsonConvert.convert<String>(json['cate_id']);
	if (cateId != null) {
		jingangForHomeData.cateId = cateId;
	}
	return jingangForHomeData;
}

Map<String, dynamic> $JingangForHomeDataToJson(JingangForHomeData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['sort'] = entity.sort;
	data['link'] = entity.link;
	data['img_path'] = entity.imgPath;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	data['cate_id'] = entity.cateId;
	return data;
}